<template>
  <div class="app-container">
    <!-- 顶部 Header 区域 -->
    <mt-header fixed title="Vue项目"></mt-header>

    <!-- 中间 路由 router-view 区域 -->
    <div class="transition-box">
      <transition>
        <router-view></router-view>
      </transition>
    </div>
    <!-- 底部 Tabbar 区域 -->
    <nav class="mui-bar mui-bar-tab">
      <router-link to="/home" class="my-tab-item">
        <span class="mui-icon mui-icon-home"></span>
        <span class="mui-tab-label">首页</span>
      </router-link>
      <router-link to="/member" class="my-tab-item">
        <span class="mui-icon mui-icon-contact"></span>
        <span class="mui-tab-label">会员</span>
      </router-link>
      <router-link to="/shopcar" class="my-tab-item">
        <span class="mui-icon mui-icon-extra mui-icon-extra-cart">
          <span class="mui-badge" id="badge">{{$store.getters.getAllCount}}</span>
        </span>
        <span class="mui-tab-label">购物车</span>
      </router-link>
      <router-link to="/search" class="my-tab-item">
        <span class="mui-icon mui-icon-search"></span>
        <span class="mui-tab-label">搜索</span>
      </router-link>
    </nav>
  </div>
</template>

<script>
</script>

<style lang="scss">
body,
ul,
p,
h1,
h2,
h3,
h4,
dl,
dd,
form,
input,
textarea,
select {
  padding: 0;
  margin: 0;
  font-weight: normal;
}
div {
  display: block;
  padding: 0;
  margin: 0;
}
img {
  border: none;
  padding: 0;
  margin: 0;
  vertical-align: bottom;
}
a {
  text-decoration: none;
}
.fl {
  float: left;
}
.fr {
  float: right;
}
li {
  list-style: none;
}
table {
  border-collapse: collapse;
}
.clear {
  zoom: 1;
  clear: both;
}
.clear:after {
  content: "";
  display: block;
  clear: both;
}
html,
body {
  min-height: 100%;
}
body {
  padding: 40px 0 50px 0;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}
* {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.app-container {
  height: 100%;
  .mint-header.is-fixed {
    z-index: 9999;
  }
  .transition-box {
    overflow-x: hidden;
    height: 100%;
  }
}
.v-enter {
  transform: translateX(100%);
  position: fixed;
  top: 40px;
  left: 0;
}
.v-leave-to {
  transform: translateX(-100%);
  position: fixed;
  top: 40px;
  left: 0;
}

.v-enter-active,
.v-leave-active {
  transition: all 0.5s ease;
}
.mui-bar {
  z-index: 9999;
}
.mui-bar-tab {
  .my-tab-item {
    display: table-cell;
    overflow: hidden;
    width: 1%;
    height: 50px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #929292;
    .mui-icon {
      top: 3px;
      width: 24px;
      height: 24px;
      padding-top: 0;
      padding-bottom: 0;
    }
    .mui-icon ~ .mui-tab-label {
      font-size: 11px;
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
  .my-tab-item.mui-active {
    color: #007aff;
  }
}
</style>
